package com.design.myiterator.football;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xiemiao
 * @description
 * @date 2023/08/17
 */
public class Team implements Iterable<Player> {

    private List<Player> team = new ArrayList<>();

    public void addPlayer(Player player) {
        team.add(player);
    }

    @Override
    public Iterator<Player> iterator() {
        return new PlayerIterator<>(team);
    }
}
